Skip to main content

contains

Type

operator

Summary

Compares two strings and evaluates to true if the first contains the second, false if not.

Syntax

<string> contains <substring>

Description

Use the contains operator to find out whether a string contains a substring.

If the substring is found in the string, the contains operation evaluates to true.

If each character of the substring can be found in the string, but the characters are separated, the contains operation evaluates to false.

Parameters

NameTypeDescription

string

string

The string and substring are both strings of characters, or expressions that evaluate to strings.

substring

string

Examples

"ABC" contains "A" -- evaluates to true
"123" contains "13" -- evaluates to false

glossary: operator, operation, evaluate, string

keyword: string, characters

operator: equals, less-than-or-greater-than, is in, is among, is not among, ends with, is not in

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?